# _*_ coding: utf-8 _*_
# @Time : 2024-01-20 19:12
# @Author : wf

from selenium import webdriver


# 封装方法
def share_broswer():
    options = webdriver.ChromeOptions()
    options.binary_location = r'C:\Program Files\Google\Chrome\Application\chrome.exe'
    options.add_experimental_option('detach', True)
    options.add_experimental_option("excludeSwitches", ["enable-automation"])  # 禁止控制提示

    options.add_argument('--start-maximized')  # 设置窗口最大化
    options.add_argument('--headless')  # 设置无窗口模式
    options.add_argument('--disable-gpu')  # 禁用gpu加速

    driver = webdriver.Chrome(options=options)
    return driver
